import { MockMethod } from 'vite-plugin-mock'
import Mock from 'mockjs'

const gengrateData = () => {
  const gen = Mock.Random
  const MockData = Mock.mock({
    'list|10': [{
      'id|+1': 1,
      date: gen.date(),
      name: gen.name(),
      state: gen.county(),
      city: gen.city(),
      address: gen.region()
    }]
  })
  return {
    ...MockData,
    total: 20
  }
}
export default [
  {
    url: '/test/getTableData',
    timeout: 200,
    method: 'get',
    response: () => {
      return {
        code: 0,
        data: gengrateData(),
        msg: 'success'
      }
    }
  }
] as MockMethod[]
